<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.longtop.com/intelliweb" prefix="e"%>
<%@ page isELIgnored="false"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>
		选择考核阶段-员工窗口-SJH
	</title>
</head>
<e:View id="eView" designProperty="width: 1024px; height: 768px">
	<script type="text/javascript">SkinUtil.getSkin();</script>
	<script type="text/javascript">SkinUtil.getModuleSkin();</script>	
	<script type="text/javascript" src="<c:url value='/js/perform/perform.js'/>"></script>
	
	<div id="Invisual Controls" style="display: none;" style="min-height: 40px; background-color: LemonChiffon;" >
		<e:Dataset id="Dataset_task_user" pageSize="30" 
				loadDataCommand="Command_load" allowMultiSelect="true">
			<e:Field name="userId" dataType="string" label="id" maxLength="32" />
			<e:Field name="userName" dataType="string" label="name" maxLength="200" />
			<e:Field name="orgName" dataType="string" label="orgName" maxLength="100" />
		</e:Dataset>
		 
		<e:Command id="Command_load" action="com.longtop.perform.khyg.web.TaskUserWindowAction" 
			method="load" showHintInfoOnSuccess="false" onBeforeExecute="cmd_load_onBeforeExecute(command)">
			<e:DatasetInfo name="info" dataset="Dataset_task_user" alwayRefreshClient="true" submitType="none"></e:DatasetInfo>
			<e:Parameter name="segmentId" value="${param.segmentId}"></e:Parameter>
		</e:Command>
		<e:Command id="Command_search" action="com.longtop.perform.khyg.web.TaskUserWindowAction" 
			method="search" submitForm="true">
			<e:DatasetInfo name="info" dataset="Dataset_task_user" alwayRefreshClient="true" submitType="none"></e:DatasetInfo>
			<e:Parameter name="segmentId" value="${param.segmentId}"></e:Parameter>
		</e:Command>
		
		<e:LookupDropDown id="LookupDropDown_Org" path="/jsp/framework/sys/org/orgDropdown.jsp"	windowWidth="400" windowHeight="450" 
				autoDropDown="true" fixed="true" onSelect="LookupDropDown_Org_onSelect(dropdown,iframe,text)" windowCaption="选择部门">
		</e:LookupDropDown>	
	</div>
<body style="overflow: hidden">
<e:Page id="ePage" action="com.longtop.perform.khyg.web.TaskUserWindowAction" style="min-height: 80px; width: 100%; height: 100%;"
	onAfterLoadPage="ePage_onAfterLoadPage()" onBeforeLoadPage="ePage_onBeforeLoadPage()">
	<table style="width: 100%;height:100%" border="0" cellpadding="2" cellspacing="2">
		<tbody>
			<tr>
				<td align="left" valign="top">
					<e:Panel id="Panel_query" style="width: 230px;height:100%" caption="用户查询条件" captionIcon="/images/query_win.gif"
							captionStyle="color:#888888" allowFold="true" showArrowButton="false">
						<table style="text-align: left; width: 100%;" border="0" cellpadding="3" cellspacing="3" align="center">
								<tr><td><e:Label id="Label_userId" caption="员工ID："/></td></tr>
								<tr>
									<td><e:Text id="Text_userId" style="width:150px"/></td>
								</tr>
								<tr><td><e:Label id="Label_userName" caption="员工名称："/></td></tr>
								<tr>
									<td><e:Text id="Text_userName" style="width:150px"/></td>
								</tr>
								<tr><td><e:Label id="Label_orgName" caption="所属机构："/></td></tr>
								<tr>
									<td><e:Text id="Text_orgName" dropDown="LookupDropDown_Org" style="width:150px"/></td>
								</tr>
								<tr>
									<td align="left">
										<e:Button id="Button_Search" style="height: 22px; width: 70px;;" caption="查询" icon="/images/query.gif" command="Command_search"></e:Button>&nbsp;&nbsp;
										<e:Button id="Button_reset" style="height: 22px; width: 70px;;" caption=" 重置" icon="/images/refresh.gif" onClick="resetQueryCondition()"></e:Button>
									</td>
								</tr>																																																
						</table>
					</e:Panel>
				</td>
				<td valign="top" width="100%">
						<table style="text-align: left; width: 100%;height: 100%" border="0" cellpadding="2" cellspacing="2" align="center">
							<tr>
								<td valign="top">
									<e:Grid id="Grid_Result" style="width: 100%; height:450px;" dataset="Dataset_task_user" showIndicator="false"
											showIndex="true" readOnly="true" >
										<e:Column name="userName" label="员工ID" field="userId" dataType="string" style="width:26%"></e:Column>	
										<e:Column name="userName" label="员工名" field="userName" dataType="string" style="width:26%"></e:Column>	
										<e:Column name="orgName" label="机构名称" field="orgName" dataType="string" style="width:48%"></e:Column>										
									</e:Grid>
								</td>
							</tr>
							<tr>
								<td>
									<e:PageNavigator id="PageNavigator_User" dataset="Dataset_task_user" style="height: 27px;"></e:PageNavigator>
								</td>
							</tr>
							<tr>
								<td align="center" valign="middle">
									<e:Button id="Button_ok" caption="确定" style="width:75" onClick="Button_ok_onClick()" icon="/images/submit.gif" /> &nbsp; 
									<e:Button id="Button_close" caption="关闭" style="width:75" onClick="window.close()" icon="/images/delete.gif" /> &nbsp;
								</td>
							</tr>																
						</table>
				</td>
			</tr>
		</tbody>
    </table>
</e:Page>
</body>
<script type="text/javascript">
	var segmentId = "${param.segmentId}";
	//init
	function ePage_onBeforeLoadPage(){
		var showSelect = "${param.showSelect}"
		//是否需要显示selectBox
		if(showSelect == 'false'){
			Dataset_task_user.allowMultiSelect=false;
		}
	}
	function ePage_onAfterLoadPage(){
		Command_search.execute();
	}
	
	//选择部门
	function LookupDropDown_Org_onSelect(dropdown,iframe,text){
		var dataset= $J(iframe.Dataset_Org);
    	if(dataset){
	    	var record = dataset.getCurrentRecord();
	    	if(typeof record != "undefined" && record != null){
	       		$J("Text_orgName").setValue(record.getValue("orgId"),record.getValue("orgName"));
	    	}
		}
	}

	//确定：
	function Button_ok_onClick(){
	    var array = new Array();
	    var record = $J('Dataset_task_user').getFirstRecord();
	    while (record != null){
	        if (record.isSelected){
	            var map = new Map();
	        	var fields = $J('Dataset_task_user').fields;
	        	for(var i = 0 ; i<fields.length ; i++){
	        		map.put(fields[i].name,record.getValue(fields[i].name));
	        	}
	            array.push(map);
	        }
	        record = record.getNextRecord();
	    }
	    window.returnValue = array.join("|");
	    window.close();
	}
</script>
</e:View>
</html>
